package com.jxc.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.springframework.transaction.annotation.Transactional;

import com.jxc.dao.EmployeeRoleDAO;

/**
 * @包名   com.jxc.system.role.imp
 * @文件名 EmployeeRoleImpl.java
 * @作者   mopzyqing
 * @创建日期 Jul 20, 2010
 * @版本 V 1.0
 */
@Transactional
public class EmployeeRoleImpl implements EmployeeRoleDAO{

	@Resource private SessionFactory sessionFactory;
	//通过员工ID查询角色
	public List QueryRoleIDByEmployeeid(int EmployeeID){
		
		String queryString="select tbRole.roleId from TbEmployeeRole where tbEmployee.id="+EmployeeID;
		Query queryObject = sessionFactory.getCurrentSession().createQuery(
				queryString);
		return queryObject.list();
	}
}
